package com.boang.ch;

import java.io.*;

/*
  @author: 13813
  @date: 2024/12/12 14:11
*/
public class BufferWriterReaderDemo {
    public static void main(String[] args) throws IOException {
        FileReader fileReader = new FileReader("C:\\Users\\13813\\Desktop\\62\\Java开发手册.pdf");
        BufferedReader bufferedReader = new BufferedReader(fileReader);

        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("C:\\Users\\13813\\Desktop\\Java开发手册2.pdf"));

        String str = null;

        long start = System.currentTimeMillis(); //毫秒

        while ((str = bufferedReader.readLine()) != null) {
            bufferedWriter.write(str);
            bufferedWriter.newLine();
        }

        bufferedReader.close();
        bufferedWriter.close();

        long end = System.currentTimeMillis();

        System.out.println(end - start);

        /*String s1 = bufferedReader.readLine();
        System.out.println(s1);

        String s2 = bufferedReader.readLine();
        System.out.println(s2);

        String s3 = bufferedReader.readLine();
        System.out.println(s3);

        String s4 = bufferedReader.readLine();
        System.out.println(s4);

        String s5 = bufferedReader.readLine();
        System.out.println(s5);*/
    }
}
